<template>
	<view class="cardShadow">
		<template>
			<view class="title">
				{{ item.category[$t('item.name')] || $t("暂无信息") }}
			</view>
			<view class="lineP">
				<view style="flex: 1;">
					<view class="lineP">
						<Tag class="u-margin-bottom-14" :text="$t(item.whole_diffuse) || ''" color="#13b5b1">
						</Tag>
						<Tag class="u-margin-bottom-14" :text="item[$t('item.load_num')]+'kg'" color="#ef9b17"></Tag>
						<Tag class="u-margin-bottom-14" :text="item[$t('item.goods_volume')]+'m³'" color="#22ac38">
						</Tag>

					</view>
					<view class="lineP u-margin-bottom-0">
						<FromToCountry :item="item"></FromToCountry>
					</view>
				</view>
				<view class="carPicture">
					<img :src="toImages(item.category.image)" alt="" />
				</view>
			</view>

			<view class="lineP">
				{{item.car_l + 'm*'  + item.car_w + 'm*'  + item.car_h + 'm' || ''}}
			</view>
			<view class="lineP">
				<img :src="HTTP_IMG_UTL+'location.png'" class="headline_img" />
				<view class="u-flex-1">{{item.hyd || $t("暂无信息") }}</view>
			</view>
			<view class="lineP">
				<img :src="HTTP_IMG_UTL+'transportIcon1.png'" class="headline_img" />
				<view class="u-flex-1">{{item.shd || $t("暂无信息") }}</view>
			</view>
			<view class="u-margin-bottom-20">
				<TransportType :item="item"></TransportType>
			</view>
			<!-- <view class="carPicture">
				<img :src="HTTP_IMG_UTL+'huowuPic1.png'" alt="" />
			</view> -->
		</template>
		<!-- <template v-if="type == 2">
			<view class="title">
				{{ item[$t('item.person_name')] || $t("暂无信息") }}
			</view>
			<view class="lineP">
				<img :src="HTTP_IMG_UTL+'agencyIcon4.png'" alt="" />
				<view class="label">{{ $t('任务要求') }}:</view>
				<view class="text">{{item[$t('item.skill')] || $t("暂无信息") }}</view>
			</view>
			<view class="lineP">
				<img :src="HTTP_IMG_UTL+'agencyIcon5.png'" alt="" />
				<view class="label">{{ $t('任务时长') }}:</view>
				<view class="text" style="flex: 0 0 380rpx;">{{item[$t('item.speed')] || 0 }}</view>
			</view>
			<view class="lineP">
				<img :src="HTTP_IMG_UTL+'agencyIcon3.png'" alt="" />
				<view class="label">{{ $t('所在城市') }}:</view>
				<view class="text">{{item.personcitys[$t('item.city.mergename')] || $t("暂无信息") }}</view>
			</view>
			<view class="price">
				<view class="text">
					<view class="small">
						{{$t("价格")}}
					</view>
					{{item.price}}{{$t(item.price_unit)}}
				</view>
				<img :src="HTTP_IMG_UTL+'agencyIcon6.png'" alt="" />
			</view>
		</template> -->
	</view>
</template>

<script>
	import TransportType from '@/components/TransportType.vue'
	import {
		createC2CConversation,
		isBase64,
		time
	} from "@/common/public";
	import FromToCountry from '@/components/FromToCountry.vue'

	import Tag from '@/components/Tag.vue'
	import {
		IMAGE_URL,
		HTTP_IMG_UTL
	} from "@/config/app";
	export default {
		components: {
			Tag,
			FromToCountry,
			TransportType
		},
		props: {
			item: {
				type: Object,
				default: {},
			},
			type: {
				type: String,
				default: '1',
			},
		},
		computed: {
			toImages() {
				return (src) => {
					return isBase64(src) ? src : IMAGE_URL + src
				}
			},
		},
		data() {
			return {
				HTTP_IMG_UTL
			};
		},
		methods: {
			time
		}
	}
</script>

<style lang="scss" scoped>
	.carPicture {
		// position: absolute;
		bottom: 42%;
		right: 20rpx;

		img {
			height: 140rpx;
			width: 270rpx;
		}
	}

	.lineP {
		display: flex;
		align-items: center;
		margin-bottom: 8px;
		position: relative;
		font-size: 16px;
		position: relative;
		flex-wrap: wrap;


		&.shot {
			width: 50%;
			flex-wrap: wrap;


		}



		.headline_img {
			width: 30rpx;
			height: 30rpx;
			margin-right: 10rpx;
		}

		.label {
			font-weight: 600;
			margin-bottom: 10rpx;
		}
	}

	.title {
		color: #e43b14;
		font-size: 38rpx;
		// border-top: 1rpx solid #cccccc;
		font-weight: 600;
		margin-top: 10rpx;
		word-break: break-all;
		// min-height: 80rpx;
		margin-bottom: 20rpx;
		text-align: center;
	}
</style>